<template>
  <div class="app-container">
    <el-table
      v-loading="listLoading"
      :data="list"
      element-loading-text="Loading"
      border
      fit
      highlight-current-row
    >
      <el-table-column align="center" label="ID" width="50">
        <template slot-scope="scope">
          {{ scope.$index +1 }}
        </template>
      </el-table-column>
      <el-table-column label="学号" width="110" align="center">
        <template slot-scope="scope">
          {{ scope.row.studentid }}
        </template>
      </el-table-column>
      <el-table-column label="姓名" width="80" align="center">
        <template slot-scope="scope">
          {{ scope.row.name }}
        </template>
      </el-table-column>
      <el-table-column label="普通话口语" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a1 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="大学英语读写1" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a2 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="大学英语听说1" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a3 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="大学生职业规划" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a4 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="军事理论" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a5 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="马克思主义" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a6 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="c++程序设计1" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a7 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="计算机导论" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a8 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="高等数学A1" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a9 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="形势政策" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a10 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="思想道德修养" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a11 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="大学英语读写2" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a12 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="大学英语听说2" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a13 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="大学生心理健康教育" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a14 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="数字电路" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a15 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="大学体育" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a16 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="汇编语言" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a17 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="高等数学A2" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a18 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="线性代数A1" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a19 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="C++程序设计A2" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a20 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="C++程序设计" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a21 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="学业总成绩" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a22 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="学业总成绩排名" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a23 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="量化总成绩" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a24 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="量化总成绩排名" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a25 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="综合成绩" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a26 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="综合成绩排名" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.a27 }}</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { getAllExamInfo } from '@/api/exam'

export default {
  filters: {
    statusFilter(status) {
      const statusMap = {
        正常: 'success',
        休学: 'gray',
        退学: 'danger'
      }
      return statusMap[status]
    }
  },
  data() {
    return {
      list: null,
      listLoading: true,
      value: ''
    }
  },
  created() {
    this.fetchData()
  },
  methods: {
    fetchData() {
      this.listLoading = true
      getAllExamInfo().then(response => {
        this.list = response.data.items
        this.listLoading = false
      })
    }
  }
}
</script>
